Skip to content

Conversation

@the8472
Copy link
Member

@the8472 the8472 commented Oct 26, 2025

cleaning up disk space takes a lot of time, sometimes 30 minutes

@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Oct 26, 2025
@the8472 the8472 force-pushed the ci-use-extra-disk branch 2 times, most recently from b040885 to 4848df3 Compare October 26, 2025 17:02
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

cleaning up disk space takes a lot of time
@the8472 the8472 marked this pull request as ready for review October 26, 2025 19:04
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 26, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 26, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 26, 2025

r? @marcoieni

rustbot has assigned @marcoieni.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@the8472
Copy link
Member Author

the8472 commented Oct 26, 2025

OLD https://github.com/rust-lang/rust/actions/runs/18821126435
NEW https://github.com/rust-lang/rust/actions/runs/18821542169

image

# The availability of the disks we're probing isn't guaranteed,
# so this is opportunistic.
checkAlternative() {
local mountpoint="/mnt"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find confusing naming the variable as the mountpoint command

local mntopts="defaults,discard,journal_async_commit,barrier=0,noauto_da_alloc,lazytime,data=writeback"

# GHA has a 2nd disk mounted at /mnt that is almost empty
if mountpoint /mnt && [ "$available_space_kb" -ge "$space_target_kb" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we reuse the variable instead of hardcoding /mnt?

# ignore-tidy-linelength
local mntopts="defaults,discard,journal_async_commit,barrier=0,noauto_da_alloc,lazytime,data=writeback"

# GHA has a 2nd disk mounted at /mnt that is almost empty
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# GHA has a 2nd disk mounted at /mnt that is almost empty
# GHA has a 2nd disk mounted at /mnt that is almost empty.
# Check if it's a valid mountpoint and it has enough available space.

sudo mount $blkdev ./obj -o $mntopts || sudo dmesg | tail -n 20
sudo chown -R "$USER":"$USER" ./obj

exit 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
exit 0
# Exit from this script to avoid wasting time removing disk space,
# as we already have enough disk space in the alternative drive.
exit 0

Comment on lines +265 to +272
local blkdev=$(df -k "$mountpoint" --output=source | tail -n 1)
echo "Sufficient space available on $blkdev mounted at $mountpoint"
sudo swapoff -a || true
mkdir ./obj
# remount with O_EATMYDATA while we're at it
sudo umount /mnt
sudo mount $blkdev ./obj -o $mntopts || sudo dmesg | tail -n 20
sudo chown -R "$USER":"$USER" ./obj
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add more comments explaining what you are doing here? 🙏

@marcoieni
Copy link
Member

I have no objections if this works as it seems faster than freeing up disk space 🙌
Let's make sure to try this on many jobs to prevent the auto build to fail.
I would definitely mark this as rollup never.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants